<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableKmsUserConfig extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kms_user_config', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("userId")->default(0)->comment("rmsUserID");
            $table->unsignedTinyInteger("fieldSwitch")->default(0)->comment("外勤启用状态 0 - 关闭 1 - 开启");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('删除');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = 'kms - 用户关联配置表';
            $table->index("userId", "idx_userId");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kms_user_config');
    }
}
